package com.example.springbootServiceNetwork.demos.web.Tool;


public class WrapperMethodUtil {


    /**
     * 拼接字符串转一维数组
     *  str
     */
    public static String[] StrToList(String str) {
        return str.split(",");
    }

    /**
     * 字符串素组判断某个字符串是否存在
     *  arr
     *  str
     */

    public static Boolean listBool(Object arr,String str) {
        String[] strArr =StrToList(String.valueOf(arr));
        for (String strName:strArr) {
            if (strName.contains(str)) {
                return true;
            }
        }
        return false;
    }

    /**
     * 判断权限是否存在
     */
    public static Boolean bollPurvieTool(String[] list,String str){
        String[] list2 = str.split(",");
        for (String item:list) {
            for (String item2:list2) {
             if (item.equals(item2)){
                 return true;
             }
            }
        }
        return false;
    }

}
